package com.studiofortress.sf.structure;

import com.studiofortress.sf.graphics.display.ControlEvent;
import com.studiofortress.sf.util.collections.CallbackPartialIterator;

/**
 * Helper class to define a common callback iterator that has a single field
 * for holding a control event.
 * @param <A>
 * @param <E>
 */
abstract class ControlEventCallbackPartialIterator<A, E extends ControlEvent> extends CallbackPartialIterator<A>
{
    protected E event;

    /**
     * @return True if this iterator it still iterating and the event it contains has not yet been handled.
     */
    @Override
    public boolean isIterating()
    {
        return super.isIterating() && !event.isHandled();
    }
}
